
<include file="Public/header"/><body>
<script src="__STATIC__/js/jquery.artalert.js"></script>
<script type="text/javascript" src="__STATIC__/js/TouchSlide.1.1.js"></script>

<div id="scrollimg" class="scrollimg">
  <div class="bd">
	 <ul>
	 	<adv pid ="403" limit="5" item="v">
	    	<li><a href="{$v.ad_link}" <if condition="$v['target'] eq 1">target="_blank"</if> ><img src="{$v[ad_code]}" title="{$v[title]}"width="100%" style="{$v[style]}"/></a></li>
     	</adv>                        
     </ul>
  </div>
  
  <div class="hd">
	<ul></ul>
  </div>
</div>
<script type="text/javascript">
	TouchSlide({ 
		slideCell:"#scrollimg",
		titCell:".hd ul", //开啟自动分页 autoPage:true ，此时设置 titCell 為导航元素包裹层
		mainCell:".bd ul", 
		effect:"leftLoop", 
		autoPage:true,//自动分页
		autoPlay:true //自动播放
	});
</script> 



<div id="tbh5v0">
<!--------筛选 form 表单 开始-------------->
      <div class="Evaluation3">
            <ul>
              	<li><a href="{:U('coupon/index')}" class="tab_head <if condition='$_GET[cateid] eq 0'>on</if>" id="goods_ka1">全部</a></li>
	      	<li><a href="{:U('coupon/index',array('cateid'=>1))}" class="tab_head <if condition='$_GET[cateid] eq 1'>on</if>" id="goods_ka1">满减卷</a></li>
	        <li><a href="{:U('coupon/index',array('cateid'=>2))}" class="tab_head <if condition='$_GET[cateid] eq 2'>on</if>" id="goods_ka3">折扣券</a></li>
	        <li><a href="{:U('coupon/index',array('cateid'=>3))}" class="tab_head <if condition='$_GET[cateid] eq 3'>on</if>" id="goods_ka2">现金券</a></li>
            </ul>
      </div>     
      
      <style>
		  .couponlist { width: 95%; padding: 10px 0; margin: 0 auto;}
		  .couponlist div{ position: relative;width: 100%;margin: 10px 0;}
		  .couponlist a{  display: block; width: 100%;}
		  .couponlist a img{ width: 100%;}
		  .couponlist b{position: absolute; height: 100%; width: 100%; background: rgba(0,0,0,0.4);z-index: 9;vertical-align: middle; display: none;}
		  .couponlist b img{ width:25%;right: 10px; position: absolute;}
		</style>
	<div class="couponlist">
		<volist name="coupon_list" id="coupon">
			<div id="coupon_{$coupon.id}">
				<b><img src="__PUBLIC__/images/coupon_end.png" ></b>
				<a href="javascript:void();" onClick="save_coupon({$coupon.id})"><img src="{$coupon.original_img}" ></a>
			</div>
		</volist>
    </div>
  
        
</div>

<script language="javascript">
$(document).ready(function(){
	//$('.couponlist b').css('width',$('.couponlist').find('a').find('img').height());
	//alert($('.couponlist').find('a').find('img').height()/2);
	//$('.couponlist b').css('top',$('.couponlist').find('a').find('img').height()/2);
	//$('.couponlist b').css('top',$('.couponlist').find('a').find('img').height()/2-$('.couponlist b img').height()/2);
	
	//$('.couponlist b img').css('top',$('.couponlist').find('b').height()/2-$('.couponlist b img').height()/2);
	
	
});


 function save_coupon(id)
 {	 	
		$.ajax({
			type : "GET",
			dataType: "json",
			//url:"{:U('Mobile/Coupon/save_coupon')}",
			url:"/index.php?m=Mobile&c=coupon&a=save_coupon&id="+id,//+tab,			
			//data:{id:id},
			success: function(data)
			{
				if(data.status=="-1")
					//$.artTip(data.msg, 800)
					alert(data.msg);
				else  
				{
					
					$("#coupon_"+data.result).find('b').show();
					$("#coupon_"+data.result+" b img").css('top',$("#coupon_"+data.result).find('b').height()/2-$("#coupon_"+data.result+" b img").height()/2);
	
					//alert(data.msg);
					
					//$.artTip(data.msg, 800)
				}
			}
		}); 
 }

</script>

<include file="Public/footer_nav"/>
</body>
</html>